package mo.daliy;

public class L1684 {

    public int countConsistentStrings(String allowed, String[] words) {
        boolean[] allowTable = new boolean[26];
        for (char c : allowed.toCharArray()) {
            allowTable[c-'a'] = true;
        }
        int res = 0;
        for (String word : words) {
            boolean match = true;
            for (char c : word.toCharArray()) {
               if (!allowTable[c-'a']) {
                   match = false;
                   break;
               }
            }
            if (match) {
                res++;
            }
        }
        return res;
    }

}
